﻿using System;

namespace MessagePack.Decoders
{
	// Token: 0x020000D1 RID: 209
	internal class Ext16 : IExtDecoder
	{
		// Token: 0x06000318 RID: 792 RVA: 0x0000C0C1 File Offset: 0x0000A4C1
		private Ext16()
		{
		}

		// Token: 0x06000319 RID: 793 RVA: 0x0000C0CC File Offset: 0x0000A4CC
		public ExtensionResult Read(byte[] bytes, int offset, out int readSize)
		{
			int num = (int)((ushort)(bytes[offset + 1] << 8) | (ushort)bytes[offset + 2]);
			sbyte typeCode = (sbyte)bytes[offset + 3];
			byte[] array = new byte[num];
			readSize = num + 4;
			Buffer.BlockCopy(bytes, offset + 4, array, 0, num);
			return new ExtensionResult(typeCode, array);
		}

		// Token: 0x040000ED RID: 237
		internal static readonly IExtDecoder Instance = new Ext16();
	}
}
